package com.woniu.product.feign;

import com.woniu.entity.Result;
import com.woniu.product.pojo.Product;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "product-service", path = "product", contextId = "product")
public interface ProductFeignClient {

    @GetMapping("/{id}")
    public Result<Product> selectProductById(@PathVariable("id") String id);

    @GetMapping("/{id}/{productQuantity}")
    public Result updateStock(@PathVariable("id") String id, @PathVariable("productQuantity") Integer productQuantity);
}
